import json

from flask import Blueprint
from flask import jsonify
from flask import request

from service.recommend_service import get_recommend_result

recommend_blueprint = Blueprint('recommend', __name__)


@recommend_blueprint.route('/recommend', methods=['GET'])
def recommend():
    uid = request.args.get('uid', '')
    recommend_res = get_recommend_result(uid)
    return jsonify(json.dumps(recommend_res, ensure_ascii=False))
